<?php
	class TutorLandAccountModel extends Model {
		function TutorLandAccountModel()
		{
			parent::Model();			
		}
		
		function add($data)
		{
			$this->db->insert('tutorland_account', $data);
			return $this->db->insert_id();
		}
		
				
		function update($data)
		{			
            $this->db->where('account_id', $data['account_id']);
			$this->db->update('tutorland_account', $data); 
		}
		
		
		function getAll()
		{
			$sql = " SELECT * FROM tutorland_account ac, bank b where ac.bank_id = b.bank_id and is_active = '1' ";
			$query = $this->db->query($sql);  
			return $query->result();
		}
		
		function getByID($id)
		{
			$sql = " SELECT * FROM tutorland_account ac, bank b where ac.bank_id = b.bank_id and is_active = '1' and account_id = '" . $id ."' ";
			$query = $this->db->query($sql);  
			return $query->row_array();
		}
		
		function delete($newsID)
		{
			$data = array('is_active' => '0');
            $this->db->where('account_id', $newsID);
			$this->db->update('tutorland_account', $data); 
		}
	}
?>